Page({
    data: {
        list: [
            {
                id: 'view',
                name: '行业资源',
                open: false,
                pages: ['资源置换', '请求帮助', '知识问答']
            }, {
                id: 'content',
                name: '二手闲置',
                open: false,
                pages: ['电子产品', '生活用品', '工具']
            }, {
                id: 'form',
                name: '品牌商家',
                open: false,
                pages: ['港悦优选', '美食', '休闲娱乐']
            }, {
                id: 'feedback',
                name: '顺风车',
                open: false,
                pages: ['人找车', '车找人', '货找车', '车找货']
            },  {
                id: 'media',
                name: '活动',
                open: false,
                pages: ['亲子互动', '户外体育']
            }
        ]
    },
    widgetsToggle: function (e) {
        var id = e.currentTarget.id, list = this.data.list;
        for (var i = 0, len = list.length; i < len; ++i) {
            if (list[i].id == id) {
                list[i].open = !list[i].open;
            } else {
                list[i].open = false;
            }
        }
        this.setData({
            list: list
        });
    }
});
